package com.fanghaoran.controller;
import com.fanghaoran.bean.Interaction;
import com.fanghaoran.entity.Words;
import com.fanghaoran.service.WordService;

import java.sql.SQLException;

/**
 * @Author: win11
 * @Date: 2023/03/22/13:15
 * @Description: 单词部分的控制层
 */
public class WordController {
    /**
     * 服务层对象
     */
    private final WordService wordService=new WordService();

    /**
     * 获取单词数据
     */
    public Interaction getData() throws Exception {
        return wordService.getData();
    }

    /**
     * 更新生词本
     */
    public void updateNotedBook(Words word, int userId) throws Exception {
        wordService.updateNotedBook(word,userId);
    }

    /**
     * 获取生词本数据
     */
    public Interaction getDataOfNoteBook(int userId) throws Exception {
        return wordService.getDataOfNoteBook(userId);
    }

}
